<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        .w{
            width: 600px;
            height: 600px;
            background-color: rgb(223, 125, 45);
            margin: 20px auto;
            overflow: hidden;
        }
        .son{
            width: 300px;
            height: 300px;
            background-color: rgb(219, 10, 10);
            margin: 150px auto;
            transition: 1s;
        }
        .w:hover .son{
            /* transform: translate(100px); */
            /* transform: translateY(100px); */
            transform: translateX(100px) translateY(100px);
        }
    </style>
</head>
<body>
    <div class="w">
        <div class="son"></div>
    </div>
</body>
</html>